"""
while循环
"""
import random
i = 1
sum = 0
while i<=100:
    sum+=i
    i+=1
print(f"1-100的和为：{sum}")

# 猜数字
# num = random.randint(1,100)
# i = 0
# flag = True
# while flag:
#     i+=1
#     guess_num = int(input("请输入你猜测的数字"))
#     if guess_num == num:
#         print(f"恭喜你，猜对了，总共猜了{i}次")
#         flag = False
#     elif guess_num > num:
#         print("猜大了")
#     else:
#         print("猜小了")

# print末尾加入 end=""表示不换行
print("hello",end="")
print("world",end="")
print()

# 制表符\t 对齐
print("hello\tworld")
print("zhang\tsan")

# 九九乘法表
i = 1
while i<=9:
    j = 1
    while j <= i :
        print(f"{j}*{i}={i*j}\t",end="")
        j+=1
    i+=1
    print()